﻿using System.Collections.Generic;
using System.ServiceModel;
using ClientOverflow.DataTransferObjects;

namespace ClientOverflow.CommunicationServices
{
    /// <summary>
    /// IClientOverflowService defines a contract for WCF service that serves the communication between
    /// the server side and the client side.
    /// All the object recieved and returned by this service are data trasnfer objects. The objects are
    /// "neutral" and contains no client side logic and no data layer logic.
    /// </summary>
    [ServiceContract]
    public interface IClientOverflowService
    {
        [OperationContract]
        void RegisterNewUser(User newUser);

        [OperationContract]
        void RegisterNewQuestion(Question question, User user);

        [OperationContract]
        List<Tag> GetAllTags();

        [OperationContract]
        User GetUser(string email, string password);

        [OperationContract]
        List<User> GetAllUsers();

        [OperationContract]
        List<Question> GetAllQuestions();

        [OperationContract]
        void PostAnswer(Question question, Answer newAnswer, User user);

        [OperationContract]
        void ChooseAnswer(Question question, Answer answer);

        [OperationContract]
        void AddQuestionVoteUp(Question question, User voter);
        
        [OperationContract]
        void AddQuestionVoteDown(Question question, User voter);

        [OperationContract]
        void AddAnswerVoteUp(Answer answer, User voter);

        [OperationContract]
        void AddAnswerVoteDown(Answer answer, User voter);

        [OperationContract]
        Question GetQuestion(Answer answer);
    }
}
